<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!-- load 依赖的库 -->
    <script src="../libs/system.js"></script>
    <script>
        System.import('../libs/cc.js');
    </script>

    <!-- load 一些工具函数 -->
    <script src="../src/utils/gltfParser.js"></script>
    <script src="../src/utils/ajax.js"></script>
    <script src="../src/utils/globalCache.js"></script>

    <!-- load需要的 -->
    <script src="../src/debugUtils.js"></script>
    <!--<script src="../src/graphics.js"></script>-->
    <!--<script src="../src/v1/camera.js"></script>-->
    <!--<script src="../src/v1/rendererV1.js"></script>-->
    <!--<script src="../src/v1/mesh.js"></script>-->

    <script src="../src/v1/g2d.js"></script>
    <script src="../src/v1/template_2d.js"></script>

    <script>

        let g2d;
        app.init = function () {
            g2d = new Graphics2d(__imageData);
        };
        app.render = function () {
            g2d.clear();
            g2d.drawLine(0,0,100,100,cc.Color.GREEN);
            g2d.fillRect(100,100,40,20,cc.Color.BLUE);
            g2d.drawRect(40,60,200,100,cc.Color.YELLOW);

            // 绘制一个多裁剪的
            g2d.fillTriangle(-100,50,-10,-50,50,20,cc.Color.YELLOW);
            g2d.drawTriangle(-100,50,-10,-50,50,20,cc.Color.RED);

            g2d.fillTriangle(-100 + app.width,50+app.height,-10+app.width,-50+app.height,50+app.width,20+app.height,cc.Color.YELLOW);
            g2d.drawTriangle(-100 + app.width,50+app.height,-10+app.width,-50+app.height,50+app.width,20+app.height,cc.Color.RED);
        }
    </script>
</head>
<body>

</body>
</html>
